
<!-- 状态栏高度 -->
<template>
  <view class="status" :style="{height: statusBarHeight + 'px'}"></view>
</template>

<script>
export default {
  data() {
    return {
      statusBarHeight: 0
    };
  },
  mounted() {
    this.setStatusBar();
  },
  methods: {
    setStatusBar() {
      const { statusBarHeight } = uni.getWindowInfo();
      this.statusBarHeight = statusBarHeight
    }
  }
};
</script>
